<extend name="Public/base"/>
<block name="body">
    <div class="main-title">
        <h2>添加商品详情(属性值)</h2>
    </div>
    <form action="{:U()}" method="post" class="form-horizontal">
       <foreach name="res" item="v">
        <input class="kinput" type="hidden" name="kid[]" value="{$v.id}">
        <input class="ginput" type="hidden" name="gid[]" value="{$v.gid}">
        <div class="form-item">
            <label class="item-label">商品{$v.kname}值<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large ss" name="vname[]" value="" placeholder="{$v.kname}">
        <sapn class="add-sub-cate add" title="添加子分类">
        <i class="icon-add"></i>
        </sapn>
            </div>
        </div>
        </foreach>
        <div class="form-item" style="float:left">
            <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
    <div class="form-item">
            <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal"><a href="{:U('much?id='.$id)}" style="color: #fff">下一步</a></button>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Shop/catalogue')}');
    </script>
    <script>

    $(function(){
        $(".add").click(function(){
            var index =$(".add").index($(this));
            var kid=$(".kinput").eq(index).val();
            var gid=$(".ginput").eq(index).val();
            $.get("{:U(getinval)}",{kid:kid,gid:gid},
                function(data){
                $(".add").eq(index).after(data.data);
          });
        });
    });
</script>
</block>